import React from 'react';
import {BrowserRouter, Route, Switch} from 'react-router-dom';

import App from 'Modules/App';
import Home from 'Modules/Home';
import List from 'Modules/List';
import Detail from 'Modules/Detail';
import NotFound from 'Modules/NotFound';

export default class RouteMap extends React.Component {
  render() {
    console.log('App',App)
    console.log('Home',Home)
    return (
      <BrowserRouter onUpdate={this.updateHandler}>
        <Switch>
          <Route exact path='/' component={App} />
          <Route path='/list' component={List} />
          <Route path='/detail/:id' component={Detail} />
          <Route path='*' component={NotFound} />
        </Switch>
      </BrowserRouter>
    )
  }
  updateHandler() {
    console.log("路由改变了")
  }
}
